package com.liao.furns.service.impl;

import com.liao.furns.dao.MemberDao;
import com.liao.furns.dao.impl.MemberDaoImpl;
import com.liao.furns.pojo.Member;
import com.liao.furns.service.MemberService;

/**
 * @author lzp
 * @version 1.0
 * lzpnb!
 */
public class MemberServiceImpl implements MemberService {
    private MemberDao meberDao =new MemberDaoImpl();
    @Override
    public boolean registerMember(Member member) {
        if(meberDao.saveMember(member) == 1){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public boolean isExistUsername(String name) {
        if(meberDao.queryMemberByUsername(name) != null){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public Member login(Member member) {
        return meberDao.queryMemberByUsernameAndPassword(member.getUsername(),member.getPassword());
    }
}
